package cn.com.cifi.mars.util;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

/**
 * @author: JingYuanXiang
 * @date: 2020/12/17 13:28
 */
public class MyMapUtils {

    public static Map<Integer, Object> getCoefficientMap(){
        Map<Integer, Object> coefficientMap = new HashMap<>();
        for (int i = 1; i <= 24 ; i++) {
            coefficientMap.put(i,"-");
        }
        return coefficientMap;
    }

    public static Map<Integer, Object> getMoneyMap(int max){
        Map<Integer, Object> coefficientMap = new HashMap<>();
        for (int i = 1; i <= max ; i++) {
            coefficientMap.put(i,"-");
        }
        return coefficientMap;
    }

    /**
     * 获取24个月map
     */
    public static Map<Integer, BigDecimal> getMoneyByMonthMap() {
        Map<Integer, BigDecimal> moneyByMonthMap = new HashMap<>();
        for (int i = 1; i <= 24; i++) {
            moneyByMonthMap.put(i, BigDecimal.ZERO);
        }
        return moneyByMonthMap;
    }

    public static Map<Integer, BigDecimal> moneyByMonthMapPut(Map<Integer, BigDecimal> s1,Map<Integer, BigDecimal> s2){
        Map<Integer, BigDecimal> moneyMap = MyMapUtils.getMoneyByMonthMap();
        for (Map.Entry<Integer, BigDecimal> entry : s1.entrySet()){
            moneyMap.put(entry.getKey(),moneyMap.get(entry.getKey()).add(entry.getValue()));
        }
        for (Map.Entry<Integer, BigDecimal> entry : s2.entrySet()){
            moneyMap.put(entry.getKey(),moneyMap.get(entry.getKey()).add(entry.getValue()));
        }
        return moneyMap;
    }

}
